package builderpattern;

/**
 * @author Jonny Long
 * @date 2021/5/6 8:22
 */
public class IBMProduct {
    private String monitor;
    private String keyboard;
    private String mouse;
    private Motherboard MB;

    public IBMProduct() {
    }

    public IBMProduct clone(){
        IBMProduct ibmProduct = new IBMProduct();
        ibmProduct.setKeyboard(this.keyboard);
        ibmProduct.setMonitor(this.monitor);
        ibmProduct.setMouse(this.mouse);
        Motherboard mb = MB.clone();
        ibmProduct.setMB(mb);
        return ibmProduct;
    }

    public void show() {
        System.out.println("IBM product:");
        System.out.println(this.MB.getCPU()+","+this.MB.getRAM());
        System.out.println(this.monitor);
        System.out.println(this.keyboard);
        System.out.println(this.mouse);
    }

    public void setMonitor(String monitor) {
        this.monitor = monitor;
    }

    public void setKeyboard(String keyboard) {
        this.keyboard = keyboard;
    }

    public void setMouse(String mouse) {
        this.mouse = mouse;
    }

    public void setMB(Motherboard MB) {
        this.MB = MB;
    }
}
